<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="./vue-2.4.0.js"></script> -->
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.min.js"></script>
</head>

<body>
    <div id="app">
        <mydemo>
            <template v-slot:header>
                <div>
                    我是头部
                </div>
            </template>

            <template v-slot:footer>
                <div>
                    我是尾部
                </div>
            </template>
            <!-- 我是slot展位的 -->
        </mydemo>
        <!-- <mydemo>我是普通擦超</mydemo>
        <mydemo></mydemo> -->
    </div>




    <template id="demo">
        <div class="div1">
            <h1>
                <slot name="header"></slot>
            </h1>
            <!-- <slot></slot> -->
            <h2>
                <slot name="footer"></slot>
            </h2>
        </div>
    </template>


    <script>
        Vue.component("mydemo", {
            template: "#demo"
        })


    </script>
    <script>

        let vm = new Vue({
            el: "#app"

        })

    </script>
    <style>
        .div1 {
            width: 300px;
            height: 300px;
            background-color: red;
        }
    </style>
</body>



</html>